<template>
    <div class="child">
        <h2>子组件1</h2>
        <h3>电脑：{{ computer }}</h3>
        <button @click="emitter.emit('send-toy',computer)">给弟弟玩玩电脑</button>
    </div>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import emitter from "../../utils/emitter"
let computer = ref('华硕')


</script>
<style scoped>
.child {
    background-color: rgb(76, 209, 76);
    padding: 10px;
    box-shadow: 0 0 10px black;
    border-radius: 10px;
    margin-top: 20px;
}
</style>